package com.netdisk.entity;

/**
 * 文件系统类
 * @author chenlong
 * 
 *2013-4-13
 */
public class FileSystem extends BaseNetdiskEntity{
	
	private String id; 
	
	//父路径, 如果为根目录则为..  
	private String parentDir;
	
	//存储的名字, 逻辑名称( 存储在数据库和作为磁盘文件的文件名uuid)
	private String storeName;
	
	//0是文件 ,1是文件夹
	private byte type;
	
	//文件的物理名字, 上传时候的名字,存储在数据库里面
	private String fileName;
	
	//文件的大小
	private long fileSize;
	//文件上传的日期
	private long uploadDate;
	
	//上传修改时间, 默认和上传时间一致
	private long lastModifyDate;
	
	//文件属主id
	private String ownerId;
	
	//属主名字
	private String ownerName;
	
	//文件的状态0删除, 回收站里面, 1 活动, 3非法,冻结
	private byte status = 1;
	
	//文件夹的权限
	private int power;
	
	//是否分享了地址
	//0没有分享, 1分享了
	private byte shared = 0;
	
	//文件的备注.
	private String remark;
	
	public FileSystem(){}
	
	/**
	 *  企业用户的构造函数
	 * @param companyId
	 * @param companyName
	 * @param parentDir
	 * @param storeName
	 * @param type
	 * @param fileName
	 * @param fileSize
	 * @param uploadDate
	 * @param lastModifyDate
	 * @param ownerId
	 * @param ownerName
	 * @param status
	 * @param power
	 */
	public FileSystem(String id, String companyId, String companyName,  String parentDir, String storeName, byte type,
			String fileName,long fileSize, long uploadDate, long lastModifyDate,
			String ownerId, String ownerName, byte status, int power) {
		this.id = id;
		this.companyId = companyId;
		this.companyName = companyName;
		this.parentDir = parentDir;
		this.storeName = storeName;
		this.type = type;
		this.fileName = fileName;
		this.fileSize = fileSize;
		this.uploadDate = uploadDate;
		this.lastModifyDate = lastModifyDate;
		this.ownerId = ownerId;
		this.ownerName = ownerName;
		this.status = status;
		this.power = power;
	}

	
	/**
	 * 企业文件系统构造函数(分享地址)
	 * @param companyId
	 * @param companyName
	 * @param parentDir
	 * @param storeName
	 * @param type
	 * @param fileName
	 * @param uploadDate
	 * @param lastModifyDate
	 * @param ownerId
	 * @param ownerName
	 * @param status
	 * @param power
	 * @param shared
	 * @param remark
	 */
	public FileSystem(String id,String companyId, String companyName, String parentDir, String storeName, byte type,
			String fileName, long fileSize, long uploadDate, long lastModifyDate,
			String ownerId, String ownerName, byte status, int power,
			byte shared, String remark) {
		this.id = id;
		this.companyId = companyId;
		this.companyName = companyName;
		this.parentDir = parentDir;
		this.storeName = storeName;
		this.type = type;
		this.fileName = fileName;
		this.fileSize = fileSize;
		this.uploadDate = uploadDate;
		this.lastModifyDate = lastModifyDate;
		this.ownerId = ownerId;
		this.ownerName = ownerName;
		this.status = status;
		this.power = power;
		this.shared = shared;
		this.remark = remark;
	}
	/**
	 *个人用户文件系统构造函数
	 * @param parentDir
	 * @param storeName
	 * @param type
	 * @param fileName
	 * @param uploadDate
	 * @param lastModifyDate
	 * @param ownerId
	 * @param ownerName
	 * @param status
	 * @param power
	 * @param shared
	 * @param remark
	 */
	public FileSystem(String id, String parentDir, String storeName, byte type,
			String fileName, long fileSize, long uploadDate, long lastModifyDate,
			String ownerId, String ownerName, byte status,
			byte shared, String remark) {
		this.id = id;
		this.parentDir = parentDir;
		this.storeName = storeName;
		this.type = type;
		this.fileName = fileName;
		this.fileSize = fileSize;
		this.uploadDate = uploadDate;
		this.lastModifyDate = lastModifyDate;
		this.ownerId = ownerId;
		this.ownerName = ownerName;
		this.status = status;
		this.shared = shared;
		this.remark = remark;
	}
	
	public void setId(String id ){
		this.id = id;
	}
	
	public String getId(){
		return id;
	}
	
	public String getParentDir() {
		return parentDir;
	}

	public void setParentDir(String parentDir) {
		this.parentDir = parentDir;
	}

	public String getStoreName() {
		return storeName;
	}

	public void setStoreName(String storeName) {
		this.storeName = storeName;
	}

	public byte getType() {
		return type;
	}

	public void setType(byte type) {
		this.type = type;
	}
	
	public long getFileSize() {
		return fileSize;
	}

	public void setFileSize(long fileSize) {
		this.fileSize = fileSize;
	}
	public String getFileName() {
		return fileName;
	}

	public void setFileName(String fileName) {
		this.fileName = fileName;
	}

	public long getUploadDate() {
		return uploadDate;
	}

	public void setUploadDate(long uploadDate) {
		this.uploadDate = uploadDate;
	}

	public long getLastModifyDate() {
		return lastModifyDate;
	}

	public void setLastModifyDate(long lastModifyDate) {
		this.lastModifyDate = lastModifyDate;
	}

	public String getOwnerId() {
		return ownerId;
	}

	public void setOwnerId(String ownerId) {
		this.ownerId = ownerId;
	}

	public String getOwnerName() {
		return ownerName;
	}

	public void setOwnerName(String ownerName) {
		this.ownerName = ownerName;
	}

	public byte getStatus() {
		return status;
	}

	public void setStatus(byte status) {
		this.status = status;
	}

	public int getPower() {
		return power;
	}

	public void setPower(int power) {
		this.power = power;
	}

	public byte getShared() {
		return shared;
	}

	public void setShared(byte shared) {
		this.shared = shared;
	}

	public String getRemark() {
		return remark;
	}

	public void setRemark(String remark) {
		this.remark = remark;
	}

	@Override
	public String toString() {
		return "FileSystem [id=" + id +", companyId" + getCompanyId()+ ",companyName" +getCompanyName()+ ", parentDir=" + parentDir + ", storeName="
				+ storeName + ", type=" + type + ", fileName=" + fileName + ", fileSize=" + fileSize
				+ ", uploadDate=" + uploadDate + ", lastModifyDate="
				+ lastModifyDate + ", ownerId=" + ownerId + ", ownerName="
				+ ownerName + ", status=" + status + ", power=" + power
				+ ", shared=" + shared + ", remark=" + remark + "]";
	}
}
